import request from 'alinesno-ui/src/utils/request'

var prefix = 'com/alinesno/cloud/initializr/initiallizrSeed/';

var managerUrl = {
  datatables: prefix + "datatables",
  createUrl: prefix + 'add',
  initSeedInfo: prefix + 'initSeedInfo',
  saveUrl: prefix + 'save',
  updateUrl: prefix + "modify",
  statusUrl: prefix + "changeStatus",
  cleanUrl: prefix + "clean",
  detailUrl: prefix + "detail",
  removeUrl: prefix + "delete",
  exportUrl: prefix + "exportExcel",
  generatorSeed: prefix + "generatorSeed",
  getSvnList: prefix + "getSvnList",
  genGitProject: prefix + "genGitProject",
  uploadGitProject: prefix + "uploadGitProject",
  bootVersionList: prefix + "bootVersions"
}

// 新增
export function generatorSeed(data) {
  return request({
    url: managerUrl.generatorSeed,
    method: 'post',
    data: data
  })
}

// 获取svn列表
export function initSeedInfo() {
  return request({
    url: managerUrl.initSeedInfo,
    method: 'get'
  })
}

// 获取svn列表
export function getSvnList() {
  return request({
    url: managerUrl.getSvnList,
    method: 'get'
  })
}

// 生成git project
export function generatorGitProject(data) {
  return request({
    url: managerUrl.genGitProject,
    method: 'post',
    data: data
  })
}

// 上传git project
export function uploadGitProject(data) {
  return request({
    url: managerUrl.uploadGitProject,
    method: 'post',
    timeout: 120000,
    data: data
  })
}

/**
 * 获取工程脚手架配置数据
 */
export function fetchBootVersionList() {
  return request({
    url: managerUrl.bootVersionList,
    method: 'get'
  })
}


